<template>
	<view class="content">
		<image class="bg-img" src="../../static/index/img3.jpg"></image>
	</view>
	<view class="head" v-for="(item,index) in this.Theme" :key="index">
		<uni-card class="bottom" @tap="clas(item.id)"><label class="class" >{{item.questionnaireTheme}}</label>
		</uni-card>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Theme: [],
				Title: []
			}
		},
		mounted() {
			this.getTheme()
		},
		methods: {
			getTheme() {
				uni.request({
					url: 'https://backendth.flymi.top/questionnaire',
					method: 'GET',
					data: {},
					success: res => {
						console.log(res)
						this.Theme = res.data.data;
						console.log(this.Theme)
						this.Theme.forEach((item) => {
							this.Title = item.questionnaireTitle;
						})
						console.log(this.Title)
					},
					fail: () => {},
					complete: () => {}
				});
			},
			clas(id) {
				console.log(id);
				uni.navigateTo({
					url: `/pages/Questionnaires/Record?id=${id}`
				})
			}
		}
	}
</script>

<style>
	.head {
		opacity: 0.8;
	}

	.title {
		font-size: 18px;
		padding-left: 10px;
		color: black;
		font-weight: 800;
		margin-left: 40%;
		padding-top: 2.5%;
	}

	.bg-img {
		position: fixed;
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;
		z-index: -1;
	}
</style>
